<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>GPL: inc/log/log.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="coffee_bean_77.268292682927px_1164279_easyicon.net.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">GPL
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="pages.html"><span>相关页面</span></a></li>
      <li><a href="namespaces.html"><span>命名空间</span></a></li>
      <li><a href="annotated.html"><span>类</span></a></li>
      <li class="current"><a href="files.html"><span>文件</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>文件列表</span></a></li>
      <li><a href="globals.html"><span>文件成员</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_bfccd401955b95cf8c75461437045ac0.html">inc</a></li><li class="navelem"><a class="el" href="dir_f92e94dc7eb36050fc270091fb220b30.html">log</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">log.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="log_8h.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="log_8h.html#a0fd61dcf3024ecb644d33a85de25675f">   18</a></span>&#160;<span class="preprocessor">#define LOGINIT() gpl::Log::Instance()-&gt;initlog(); </span></div><div class="line"><a name="l00019"></a><span class="lineno"><a class="line" href="log_8h.html#ac039567033dba8509501b64e55ec2de3">   19</a></span>&#160;<span class="preprocessor">#define LOGINFO(...) gpl::Log::Instance()-&gt;writeLog(L_INFO, __VA_ARGS__);  </span></div><div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="log_8h.html#a3efd03edccfaed52b31cc7e880e76091">   20</a></span>&#160;<span class="preprocessor">#define LOGERROR(...) gpl::Log::Instance()-&gt;writeLog(L_WARNING, __VA_ARGS__); </span></div><div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="log_8h.html#a6f3afad526da877eac376b88fa5e8da3">   21</a></span>&#160;<span class="preprocessor">#define LOGWARNING(...) gpl::Log::Instance()-&gt;writeLog(L_ERROR,__VA_ARGS__);</span></div><div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="log_8h.html#a6df843e6680404230f490359458ff265">   22</a></span>&#160;<span class="preprocessor">#define LOGFATAL(...) gpl::Log::Instance()-&gt;writeLog(L_FATAL,__VA_ARGS__);</span></div><div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="log_8h.html#abfa8d150d1a9a63f21f165ff59344572">   24</a></span>&#160;<span class="preprocessor">#define LOGTINFO(...) gpl::Log::Instance()-&gt;writeThreadLog(L_INFO, __VA_ARGS__);</span></div><div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="log_8h.html#ae058d6512437eeb6c853721041f0e46a">   25</a></span>&#160;<span class="preprocessor">#define LOGTERROR(...) gpl::Log::Instance()-&gt;writeThreadLog(L_ERROR, __VA_ARGS__);</span></div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="log_8h.html#aa4e2467b31b623195d78b25dba40e748">   26</a></span>&#160;<span class="preprocessor">#define LOGTWARNING(...) gpl::Log::Instance()-&gt;writeThreadLog(L_WARNING, __VA_ARGS__);</span></div><div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="log_8h.html#a01f19b65a02198fbab0251bc5b225e70">   27</a></span>&#160;<span class="preprocessor">#define LOGTFATAL(...) gpl::Log::Instance()-&gt;writeThreadLog(L_FATAL, __VA_ARGS__); </span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">namespace gpl</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;{</div><div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="namespacegpl.html#a510caae384098971b41c67806ef8cde0">   32</a></span>&#160;    <span class="keyword">typedef</span> <span class="keyword">enum</span> <a class="code" href="namespacegpl.html#a510caae384098971b41c67806ef8cde0">logLevel</a></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    {</div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="namespacegpl.html#a510caae384098971b41c67806ef8cde0afe952e016e89be5c9dcebf57f9c204bb">   34</a></span>&#160;        <a class="code" href="namespacegpl.html#a510caae384098971b41c67806ef8cde0afe952e016e89be5c9dcebf57f9c204bb">L_INFO</a> = 1, </div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="namespacegpl.html#a510caae384098971b41c67806ef8cde0a4416a69abda34968f10009e1b32d4ac7">   35</a></span>&#160;        <a class="code" href="namespacegpl.html#a510caae384098971b41c67806ef8cde0a4416a69abda34968f10009e1b32d4ac7">L_WARNING</a> = 2, </div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="namespacegpl.html#a510caae384098971b41c67806ef8cde0aa27280ffbdc22f036d0d4d303bfb3922">   36</a></span>&#160;        <a class="code" href="namespacegpl.html#a510caae384098971b41c67806ef8cde0aa27280ffbdc22f036d0d4d303bfb3922">L_ERROR</a> = 3,</div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="namespacegpl.html#a510caae384098971b41c67806ef8cde0a1bbf07e547e8b5c05bb131b0f9815739">   37</a></span>&#160;        <a class="code" href="namespacegpl.html#a510caae384098971b41c67806ef8cde0a1bbf07e547e8b5c05bb131b0f9815739">L_FATAL</a> = 4 </div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    }<a class="code" href="namespacegpl.html#aa7e5f3f22ea3394ebe1e3ca1a41b1d2a">outputLogLevel</a>;</div><div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="classgpl_1_1_log.html">   54</a></span>&#160;    <span class="keyword">class </span><a class="code" href="classgpl_1_1_log.html">Log</a></div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    {</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    <span class="keyword">public</span>:</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;        <a class="code" href="classgpl_1_1_log.html">Log</a>();</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;        ~<a class="code" href="classgpl_1_1_log.html">Log</a>();</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;        <span class="keywordtype">int</span> initlog();</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;        <span class="keywordtype">void</span> writeLog(<a class="code" href="namespacegpl.html#aa7e5f3f22ea3394ebe1e3ca1a41b1d2a">outputLogLevel</a> level, <span class="keyword">const</span> <span class="keywordtype">char</span> *format, ...);</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;        <span class="keywordtype">void</span> writeThreadLog(<a class="code" href="namespacegpl.html#aa7e5f3f22ea3394ebe1e3ca1a41b1d2a">outputLogLevel</a> level, <span class="keyword">const</span> <span class="keywordtype">char</span> *format, ...);</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;        <span class="keyword">static</span> <a class="code" href="classgpl_1_1_log.html">Log</a> * Instance();</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    <span class="keyword">private</span>:</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;        <span class="keyword">static</span> <a class="code" href="classgpl_1_1_log.html">Log</a> * m_pInstance;</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;        <span class="keywordtype">char</span> pLogBuff[2048];</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    };</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;}</div><div class="ttc" id="namespacegpl_html_a510caae384098971b41c67806ef8cde0a1bbf07e547e8b5c05bb131b0f9815739"><div class="ttname"><a href="namespacegpl.html#a510caae384098971b41c67806ef8cde0a1bbf07e547e8b5c05bb131b0f9815739">gpl::L_FATAL</a></div><div class="ttdef"><b>Definition:</b> <a href="log_8h_source.html#l00037">log.h:37</a></div></div>
<div class="ttc" id="namespacegpl_html_aa7e5f3f22ea3394ebe1e3ca1a41b1d2a"><div class="ttname"><a href="namespacegpl.html#aa7e5f3f22ea3394ebe1e3ca1a41b1d2a">gpl::outputLogLevel</a></div><div class="ttdeci">enum gpl::logLevel outputLogLevel</div></div>
<div class="ttc" id="classgpl_1_1_log_html"><div class="ttname"><a href="classgpl_1_1_log.html">gpl::Log</a></div><div class="ttdoc">日志封装类 </div><div class="ttdef"><b>Definition:</b> <a href="log_8h_source.html#l00054">log.h:54</a></div></div>
<div class="ttc" id="namespacegpl_html_a510caae384098971b41c67806ef8cde0a4416a69abda34968f10009e1b32d4ac7"><div class="ttname"><a href="namespacegpl.html#a510caae384098971b41c67806ef8cde0a4416a69abda34968f10009e1b32d4ac7">gpl::L_WARNING</a></div><div class="ttdef"><b>Definition:</b> <a href="log_8h_source.html#l00035">log.h:35</a></div></div>
<div class="ttc" id="namespacegpl_html_a510caae384098971b41c67806ef8cde0afe952e016e89be5c9dcebf57f9c204bb"><div class="ttname"><a href="namespacegpl.html#a510caae384098971b41c67806ef8cde0afe952e016e89be5c9dcebf57f9c204bb">gpl::L_INFO</a></div><div class="ttdef"><b>Definition:</b> <a href="log_8h_source.html#l00034">log.h:34</a></div></div>
<div class="ttc" id="namespacegpl_html_a510caae384098971b41c67806ef8cde0aa27280ffbdc22f036d0d4d303bfb3922"><div class="ttname"><a href="namespacegpl.html#a510caae384098971b41c67806ef8cde0aa27280ffbdc22f036d0d4d303bfb3922">gpl::L_ERROR</a></div><div class="ttdef"><b>Definition:</b> <a href="log_8h_source.html#l00036">log.h:36</a></div></div>
<div class="ttc" id="namespacegpl_html_a510caae384098971b41c67806ef8cde0"><div class="ttname"><a href="namespacegpl.html#a510caae384098971b41c67806ef8cde0">gpl::logLevel</a></div><div class="ttdeci">logLevel</div><div class="ttdef"><b>Definition:</b> <a href="log_8h_source.html#l00032">log.h:32</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
